package com.study.hot.jetpack.navigation.fragment

/**
 * <pre>
 *     author : fauks
 *     time   : 2020/03/31
 *     desc   : 使用ViewModel+LiveData可以在多个Fragment共享数据
 * </pre>
 */
/*
class GoodsViewModel : ViewModel() {
    val numbers: MutableLiveData<Int> by lazy {
        MutableLiveData<Int>(0)
    }

    */
/*fun getNumbers(): MutableLiveData<Int> {
        if (numbers == null) {
            numbers = MutableLiveData<Int>()
            numbers!!.value = 0
        }
        return numbers!!
    }*//*


    fun add(x: Int) {
        numbers.value = numbers.value?.plus(x)
        if (numbers.value!! <= 0) {
            numbers.value = 0
        }
    }
}*/
